WRAP_CLASS("itk::PathInfo")

  SET(MANAGED_TYPE_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedNoSmartPointerObject_TYPE.cxx.in)
  SET(MANAGED_WRAPPER_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedNoSmartPointerObject_WRAPPER.cxx.in)
  SET(MANAGED_SUBCLASS itk::itkNoSmartPointerObject)

  FOREACH(d ${WRAP_ITK_DIMS})
    WRAP_TEMPLATE("${d}" "${d}")
  ENDFOREACH(d)

  BEGIN_MANAGED_CONSTRUCTOR()
    SET(MANAGED_CONSTRUCTOR_SUMMARY        "Constructor.")
    SET(MANAGED_CONSTRUCTOR_TYPE_PARAMS    "void")
    SET(MANAGED_CONSTRUCTOR_WRAPPER_PARAMS "unsigned int dim")
    SET(MANAGED_CONSTRUCTOR_TYPE_BODY      "this->Initialise( ); this->m_PointerToNative = new NativeType( );")
    SET(MANAGED_CONSTRUCTOR_WRAPPER_BODY   "this->m_MangledTypeString = dim.ToString(); this->CreateInstance( nullptr );")
  END_MANAGED_CONSTRUCTOR()

  BEGIN_MANAGED_METHOD("ClearInfo")
    SET(MANAGED_METHOD_SUMMARY         "Clear the list points.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->ClearInfo( );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->ClearInfo( );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_PROPERTY("StartPoint" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the start point.")
    SET(MANAGED_PROPERTY_TYPE      "itkPoint^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedPoint<NativeType::PointType::PointDimension>( m_PointerToNative->GetStartPoint() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetStartPoint( itk::ManagedTypes::ToNativePoint<NativeType::PointType::PointDimension>(value) );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_PROPERTY("EndPoint" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the end point.")
    SET(MANAGED_PROPERTY_TYPE      "itkPoint^")
    SET(MANAGED_PROPERTY_GET_BODY  "return itk::ManagedTypes::ToManagedPoint<NativeType::PointType::PointDimension>( m_PointerToNative->GetEndPoint() );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetEndPoint( itk::ManagedTypes::ToNativePoint<NativeType::PointType::PointDimension>(value) );")
  END_MANAGED_PROPERTY()
  
  BEGIN_MANAGED_METHOD("AddWayPoint")
    SET(MANAGED_METHOD_SUMMARY         "Add a way-point to the info object.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkPoint^ way")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->AddWayPoint( itk::ManagedTypes::ToNativePoint<NativeType::PointType::PointDimension>(way) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->AddWayPoint( way );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("GetWayPoint")
    SET(MANAGED_METHOD_SUMMARY         "Get a way-point at the given zero-based index.")
    SET(MANAGED_METHOD_RETURN_TYPE     "itkPoint^")
    SET(MANAGED_METHOD_PARAMS          "unsigned int i")
    SET(MANAGED_METHOD_TYPE_BODY       "return itk::ManagedTypes::ToManagedPoint<NativeType::PointType::PointDimension>( m_PointerToNative->GetWayPoint(i) );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "return iInstance->GetWayPoint( i );")
  END_MANAGED_METHOD()

END_WRAP_CLASS()

WRAP_CLASS("itk::SpeedFunctionToPathFilter")

  SET(MANAGED_TYPE_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedImageToPathFilter_TYPE.cxx.in)
  SET(MANAGED_WRAPPER_TEMPLATE ${MANAGED_ITK_SOURCE_COMMON_PATH}/itkManagedImageToPathFilter_WRAPPER.cxx.in)

  WRAP_INCLUDE_WRAPPER( "itkManagedPathInfo.cxx" )

  # WRAP_IMAGE_FILTER_USIGN_INT(1)
  # WRAP_IMAGE_FILTER_SIGN_INT(1)
  WRAP_IMAGE_FILTER_REAL(1)

  BEGIN_MANAGED_PROPERTY("TerminationValue" GETSET)
    SET(MANAGED_PROPERTY_SUMMARY   "Get/set the value to terminate the back-propagation.")
    SET(MANAGED_PROPERTY_TYPE      "double")
    SET(MANAGED_PROPERTY_GET_BODY  "return m_PointerToNative->GetTerminationValue( );")
    SET(MANAGED_PROPERTY_SET_BODY  "m_PointerToNative->SetTerminationValue( value );")
  END_MANAGED_PROPERTY()

  BEGIN_MANAGED_METHOD("SetOptimizer")
    SET(MANAGED_METHOD_SUMMARY         "Set the optimizer.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkSingleValuedNonLinearOptimizer^ optimizer")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetOptimizer( (NativeType::OptimizerType*)optimizer->NativePointer.ToPointer() );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetOptimizer( optimizer );")
  END_MANAGED_METHOD()
  
  BEGIN_MANAGED_METHOD("GetOptimizer")
    SET(MANAGED_METHOD_SUMMARY         "Get the optimizer.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkSingleValuedNonLinearOptimizer^ optimizer")
    SET(MANAGED_METHOD_TYPE_BODY       "optimizer->NativePointer = IntPtr((NativeType::OptimizerType*)m_PointerToNative->GetOptimizer( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetOptimizer( optimizer );")
  END_MANAGED_METHOD()
  
  BEGIN_MANAGED_METHOD("SetCostFunction")
    SET(MANAGED_METHOD_SUMMARY         "Set the cost function.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkSingleValuedCostFunction^ function")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->SetCostFunction( (NativeType::CostFunctionType*)function->NativePointer.ToPointer() );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->SetCostFunction( function );")
  END_MANAGED_METHOD()
  
  BEGIN_MANAGED_METHOD("GetCostFunction")
    SET(MANAGED_METHOD_SUMMARY         "Get the cost function.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "itkSingleValuedCostFunction^ function")
    SET(MANAGED_METHOD_TYPE_BODY       "function->NativePointer = IntPtr((NativeType::CostFunctionType*)m_PointerToNative->GetCostFunction( ));")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->GetCostFunction( function );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("ClearPathInfo")
    SET(MANAGED_METHOD_SUMMARY         "Clear the list of path information objects.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "void")
    SET(MANAGED_METHOD_TYPE_BODY       "m_PointerToNative->ClearPathInfo( );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->ClearPathInfo( );")
  END_MANAGED_METHOD()

  BEGIN_MANAGED_METHOD("AddPathInfo")
    SET(MANAGED_METHOD_SUMMARY         "Add a path information object to process.")
    SET(MANAGED_METHOD_RETURN_TYPE     "void")
    SET(MANAGED_METHOD_PARAMS          "IPathInfo^ info")
    SET(MANAGED_METHOD_TYPE_BODY       "INativePointer^ iNativePtr = safe_cast<INativePointer^>(info); const NativeType::PathInfoType* infoNative = (const NativeType::PathInfoType*)iNativePtr->NativePointer.ToPointer(); m_PointerToNative->AddPathInfo( *infoNative );")
    SET(MANAGED_METHOD_WRAPPER_BODY    "iInstance->AddPathInfo( info );")
  END_MANAGED_METHOD()

END_WRAP_CLASS()
